/**
 * Edit a list of objects. This is used for editing the people contacted with
 * a company and contacts and such things.
 *
 * Usage:
 * <g:render template="/common/editList" model="[type:listType, listLabel:listLabel, id:parentObjectId, list:objectList, linkController:linkController, linkAction:linkAction, linkLabel:linkLabel, ]" />
 * g.render template:"/common/editList", model:[type:listType, listLabel:listLabel, id:parentObjectId, list:objectList]
 *
 */
<div id="editList">
  <g:render template="/common/flashMessage" />
  <div class="dialog">
    <table>
      <tbody>
        <tr class="prop">
          <td valign="top" class="name">
            <label>${label}:</label>
          </td>
        </tr>
        <tr>
          <td valign="top" class="value">
            <g:if test="${objectList}">
              <ul>
                <g:each var="obj" in="${objectList}">
                  <li>${obj}&nbsp;&nbsp;&nbsp;<mg:buttonLink action="removePerson" label="Remove" params="[id:company.id, personId:person.id]" /></li>
                </g:each>
              </ul>
            </g:if>
            <g:else>
              There are no people assigned to this company.<br />
            </g:else>
            <br />
            <g:if test="${addablePeople}">
              <g:render template="addPeopleToCompanyDialog" model="[addablePeople:addablePeople, companyId:company.id]" />
            </g:if>
            <g:else>
              There are no people available to add to this company.
            </g:else>
          </td>
        </tr>
    </table>
  </div>
</div>
